﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SportStore.Models.Abstract;
using SportStore.Models.Concrete;

namespace SportStore.Controllers
{
    public class NavController : Controller
    {
        // GET: /Nav/
        private IRepository repository = new EFRepository();

        public PartialViewResult Menu(string category=null)
        {
            ViewBag.SelectedCategory = category;
            IEnumerable<string> categories = repository.Categories.Select(x => x.Name).Distinct().OrderBy(x => x);
            return PartialView(categories);
        }

    }
}
